//package java_cup.runtime;

//import java.util.Collections;
//import java.util.LinkedList;
//import java.util.List;

public class ScannerBuffer : Scanner {
    public Scanner inner;
    public List<Node> buffer = new();

    /**
	 * Wraps around a custom scanner and stores AllVns so far produced tokens in a
	 * buffer
	 * 
	 * @param inner the scanner to buffer
	 */
    public ScannerBuffer(Scanner inner) {
        this.inner = inner;
    }

    /**
	 * Read-Only access to the buffered Symbols
	 * 
	 * @return an unmodifiable Version of the buffer
	 */
    public IReadOnlyList<Node> Buffered => buffer;

    /*@Override*/
    public Node nextToken() {
        Node buffered = inner.nextToken();
        buffer.Add(buffered);
        return buffered;
    }

}
